<?php
/**
* 这个是用户管理的界面
*/
class ModelUser extends GetLoad
{
	

	public function Getname(){


		//echo $_COOKIE['user'];

		if(isset($_COOKIE['name']))
		{
			$reluse=$this->SQLquery("SELECT * FROM name WHERE name='".$_COOKIE['name']."'and password='".$_COOKIE['password']."'");
		
			$reluse[0]['xiaoxi']=$this->Getxiaoxi($reluse[0]['name_id']);
			//var_dump($reluse[0]);
				return $reluse[0];
		}else
		{
			return 0;
		}
	}

	public function Getxiaoxi($name_id){
		$SQL=new SQLcaozuo();
		$xiaoxi=array();
		$xiaoxi['sixin']=$SQL->query2("SELECT * FROM sixin WHERE name2_id='".$name_id."' and chakan='1'")->num_rows;

		$xiaoxi['noticer']=$SQL->query2("SELECT * FROM noticer WHERE concerned_id='".$name_id."' and chakan='1'")->num_rows;
		$xiaoxi['lajixiang']=$SQL->query2("SELECT * FROM lajixiang WHERE name_id='".$name_id."' and chakan='1'")->num_rows;
		$xiaoxi['dianzan']=$SQL->query2("SELECT * FROM dianzan WHERE name_id='".$name_id."' and chakan='1'")->num_rows;
			//var_dump($SQL->query2("SELECT * FROM lajixiang WHERE name_id='".$name_id."' and chakan='1'"));
		//var_dump($xiaoxi);
		return $xiaoxi;

		
	}




}